package org.weasel.unittests;

import java.sql.Time;

import junit.framework.TestCase;

import org.weasel.business.Unscheduled;
import org.weasel.business.UserStory;

public class UnscheduledTest extends TestCase {

	private Unscheduled unscheduled;
	
	protected void setUp() throws Exception {
		super.setUp();
		unscheduled = new Unscheduled("u1", null);
	}

	protected void tearDown() throws Exception {
		super.tearDown();
		unscheduled = null;
	}

	public void testAddUserStory() {
		UserStory us = new UserStory("1", "name","03.04.2007", null, "descritpion", Time.valueOf("00:01:00"), Time.valueOf("00:01:00"), 2, 2, false, null, null);
		unscheduled.addUserStory(us);
		UserStory usCheck = unscheduled.getUserStory(us.getId());
		assertEquals(us.getId(), usCheck.getId());
	}

	public void testRemoveUserStory() {
		UserStory us = new UserStory("1", "name", "03.04.2007", null, "descritpion", Time.valueOf("00:01:00"), Time.valueOf("00:01:00"), 2, 2, false, null, null);
		unscheduled.addUserStory(us);
		unscheduled.removeUserStory(us.getId());
		assertNull(unscheduled.getUserStory(us.getId()));
	}

}
